home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1988 January
/
1988-01.d64
/
cats 'n' dogs
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
100 lines
10 rem copyright 1988 compute! publications, inc. - all rights reserved
20 ifa=1then60
30 print"[147][144] copyright 1988 compute! pub., inc."
40 printtab(10)"all rights reserved"
50 a=1:load"cats 'n' dogs.ml",8,1
60 dima(7,7),s1(18),s2(18):poke53281,14:poke53280,6:v=53248:s=54272
70 p1$="player 1":p2$="player 2":pokev+28,255:pokev+29,0:pokev+23,0
80 pokev+37,1:pokev+38,10:pokev+27,0:forn=0to7:x=50+29*n
90 poke835-n,x:poke843-n,x-19:pokev+39+n,0:next
100 pokev,70:pokev+1,60:pokev+2,250:pokev+3,60:pokev+4,165:pokev+5,220
110 poke2042,248:pokev+21,7:gosub760
120 forn=54272to54300:poken,0:next:forn=2to18:reads1(n):next
130 forn=2to18:reads2(n):next
140 forn=1to7:pokev+n*2,n*34:next:pokev+37,1:pokev+38,10:sys16385
150 h=0:ve=0:forn=53000to53098:poken,248:next
160 forn=0to6:fori=0to6:a(n,i)=0:next:next
170 m=0:pl=0:a=3:x=136:y=50:poke2040,253:poke53248,x:poke53249,y
180 pokev+16,0:pokev+21,255:pokes+24,13
190 ty=1:d1=7:forn=0to6:ifa(0,n)=0ora(0,n)=3thenty=0:d1=d1-1
200 next:ifty=1then980
210 ifd1<=3ordc<>1then230
220 dc=0:poke53000+r1+r2*7,248:a(r2,r1)=0:poke53050+r1+r2*7,248
230 j=56320+pl*jy:co=1-co:ad=55688+pl*240:forn=0to7:pokead+n,co:next
240 gety$:ify$="[133]"thenpokev+21,0:gosub760:goto150
250 forn=2to18:pokes+n,s2(n):next:ifk$="1"andpl=1then610
260 pokes+8,x+pl*14:jv=peek(j):fr=jvand16:iffr=0then300
270 jv=15-(jvand15):ifjv=8thenx=x+34:a=a+1:pokes+11,17:ifx>238thenx=34:a=0
280 ifjv=4thenx=x-34:pokes+11,17:a=a-1:ifx<34thenx=238:a=6
290 poke53248,x:goto190
300 b=0:ifa(b,a)=3thengosub720:goto400
310 ifa(b,a)<>0then190
320 co=0:ad=55688+pl*240:forn=0to7:pokead+n,co:next
330 y=y+18:poke53249,y:pokes+11,19
340 b=b+1:ifa(b,a)<>0anda(b,a)<>3thenb=b-1:goto380
350 forw=1to14:pokes+8,265-y-pl*25:y=y+2:poke53249,y:next
360 ifa(b,a)=3thena(b,a)=0:gosub720:goto400
370 ifb<6then340
380 poke53000+a+b*7,252+pl*2:a(b,a)=1-pl*2
390 pokes+11,0:poke53050+a+b*7,252+pl*2
400 pokev+21,254:m=m+1:ifm<7then420
410 sys16586:ifpeek(853)=3then480
420 pl=1-pl:poke2040,253+pl*2:x=136:y=50
430 a=3:poke53248,x:poke53249,y:pokev+21,255
440 ifdc<>1then190
450 poke53000+r1+r2*7,248:a(r2,r1)=0:poke53050+r1+r2*7,248
460 r1=int(rnd(1)*7):r2=int(rnd(1)*7):ifa(r2,r1)<>0then460
470 poke53000+r1+r2*7,250:a(r2,r1)=3:poke53050+r1+r2*7,250:goto190
480 forn=2to18:pokes+n,s1(n):next:pokes+4,23:pokes+11,35
490 ifpeek(852)=252theny=80:c1=c1+1:li=10:n=c1:n$=str$(c1)+"
500 [139][194](852)[178]254[167]y[178]200:c2[178]c2[170]1:li[178]16:n$[178][196](c2)[170]"
510 cl=35:gosub600:printn$:poke2040,peek(852):pokev,35:pokev+16,1
520 pokev+1,y:pokev+29,1:pokev+23,1:pokev+21,255
530 poke53281,2:gosub570:forn=53000to53048:poken,peek(852):next
540 gosub570:pokev+29,255:gosub570:pokev+23,255:gosub570
550 pokev+29,peek(v+29)and1:gosub570:pokev+23,peek(v+23)and1:gosub570
560 gosub590:pokes+4,0:pokev+23,0:pokev+29,0:poke53281,14:goto150
570 forw=1to25:co=1-co:forn=0to7:pokead+n,co:next:next:return
580 forw=1to300:next:return
590 forw=1to1000:next:return
600 poke214,li:print:poke211,cl:return
610 poke855,0:sys16793:r=peek(855):r=r-int(r/7)*7
620 ifpeek(853)<>3thenra=int(rnd(0)*4)+c1*2:ifra=1thenr=int(rnd(0)*7)
630 ifdc=1and(c1-c2>2)and(r=r1)thenr=int(rnd(0)*7)
640 ifr=3anda(0,3)<>0thenr=int(rnd(0)*7):ifr=3then640
650 ifr=3then710
660 ifr>3thenaa=r-3:jv=8
670 ifr<3thenaa=3-r:jv=4
680 forn=1toaa:ifjv=8thenx=x+34:a=a+1:ifx>238thenx=34:a=0
690 ifjv=4thenx=x-34:a=a-1:ifx<34thenx=238:a=6
700 pokes+8,x+pl*14:pokes+11,17:poke53248,x:forwa=1to25:next:next
710 goto300
720 pokes+13,255:pokes+12,0:pokes+11,33:forwa=19000to2000step-2500
730 pokes+8,wa/300:forn=1to10:pokev+39,n
740 pokev+1,y-n:pokev,x-n:next:pokes+8,wa/156:next
750 pokes+11,0:pokev+39,0:return
760 print"[147]"tab(11)"[158] cats 'n' dogs "
770 print"[144]press 1 [146] to play computer"
780 print"[144]press 2 [146] to play a friend":c1=0:c2=0:dc=0:jy=0
790 gosub580:poke2040,254+c:poke2041,252+c:getk$:ifk$=""thenc=1-c:goto790
800 ifk$<>"1"andk$<>"2"then790
810 ifk$="1"thenprint"plug joystick into port 2":p2$="computer":goto870
820 print"[144]how many joysticks? (press 1 or 2)
830 [161]j$:[139]j$[178]""[167]830
840 [139]j$[179][177]"1"[175]j$[179][177]"2"[167]830
850 [139]j$[178]"1"[167][153]"plug joystick into port 2":[137]870
860 jy[178]1
870 [153]"print dog catcher on? (y/n)
880 gosub580:poke2042,250+c:gety$:ify$=""thenc=1-c:goto880
890 ify$<>"y"andy$<>"n"then880
900 ify$="y"thendc=1
910 pokev+21,0:gosub590:print"[147]":ac=55327:as=1055
920 pokeac,2:pokeas,160:forn=1to8:pokeac+n,7:pokeas+n,160:next
930 ac=ac+40:as=as+40:ifas<2017then920
940 print""tab(32)"[144]cats 'n'[157][157][157][157][157][157]dogs":li=8:cl=32:gosub600
950 print""p1$:li=14:gosub600:print""p2$:return
960 data0,0,0,194,255,0,0,0,0,0,0,0,6,0,0,8,128
970 data0,0,0,0,0,0,0,0,8,0,0,252,3,0,0,8,128
980 li=5:gosub600:print"tie game":gosub720:ty=0:gosub600
990 print"[158] ":goto150